<?php
	class nhatkydb
	{
		public function Them($TenSuKien = "", $MaNguoiDung = "", $ThoiGian = "")
		{
			$sql = "INSERT INTO nhatky(TenSuKien, MaNguoiDung, ThoiGian)
						VALUES(".dataservice::QuoteSmart($TenSuKien).",
								".dataservice::QuoteSmart($MaNguoiDung).",
								".dataservice::QuoteSmart($ThoiGian).")";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
	
		public function LayDanhSach($MaNguoiDung="")	
		{
			$sql = "select * from nhatky where(1)";
				
			if($MaNguoiDung != "")
				$sql .= ' and MaNguoiDung = '.dataservice::QuoteSmart($MaNguoiDung);
			$sql .= ' order by ThoiGian desc';
			$data = new dataservice();
			return $data->ExecuteQuery($sql);
		}
	}
?>